#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    int fib(int n) {
        if (n <= 1) return n;
        int a = 0, b = 1;
        int ret = 0;
        for (int i = 2; i <= n; i++)
        {
            ret = a + b;
            a = b;
            b = ret;
        }
        return ret;
    }
};